package com.example.administrator.myapplication;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/3/14 0014.
 */
public class SecendActivity extends Activity {
    private ListView mListView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mListView = (ListView) findViewById(R.id.listView1);
        initAdapter();
    }
    private void initAdapter(){
        List<News> newsList = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            newsList.add(new News(R.mipmap.ic_launcher,"标题"+i,"我的练习"+i));
        }
       MyAdapterPractice adapter = new MyAdapterPractice(this,newsList);

        mListView.setAdapter(adapter);

    }
}
